import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { jsx as _jsx } from "react/jsx-runtime";
import { ProFormList } from '../../List';
export var formList = function formList(item, _ref) {
  var genItems = _ref.genItems;

  if (item.valueType === 'formList' && item.dataIndex) {
    var _item$getFieldProps;

    if (!item.columns || !Array.isArray(item.columns)) return null;
    return _jsx(ProFormList, _objectSpread(_objectSpread({
      name: item.dataIndex,
      label: item.label,
      initialValue: item.initialValue,
      colProps: item.colProps,
      rowProps: item.rowProps
    }, (_item$getFieldProps = item.getFieldProps) === null || _item$getFieldProps === void 0 ? void 0 : _item$getFieldProps.call(item)), {}, {
      children: genItems(item.columns)
    }), item.key);
  }

  return true;
};